package cn.tristenstudy.blog.mapper;

import cn.tristenstudy.blog.pojo.Comment;
import cn.tristenstudy.blog.pojo.dto.CommentDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author xichen1.li
 * @date 2021-01-11 15:50
 */
@Repository
@Mapper
public interface CommentMapper extends BaseMapper<Comment> {

    /**
     * 根据博客id查询评论
     *
     * @param blogId 博客id
     * @return 评论列表
     */
    List<CommentDTO> findByBlogId(@Param("blogId") Long blogId);
}
